---
title: "SQL-012: Retrieve legal case header by case number"
summary: Retrieve the legal case header row (case number, attorney, status, hearing date) via stored procedure.
status: draft
owner: SAIF Documentation Pipeline
last_reviewed: 2026-08-21
library: SAIF.Application.Claim.Legal
reference_type: embedded
---

# SQL-012 Retrieve legal case header by case number

Stored procedure call that returns a legal case header result set (case number, attorney name, case status, hearing date) for a given legal case sequence number. Invoked from `clsLegalData.New`, which is constructed from `LegalManagerBase.SetCurrentCase` when a legal case context is created or selected.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-012 |
| **Operation type** | Read |
| **Execution method** | Stored procedure (`SqlHelper.ResultSetQuery` + `AddCursorParm`) |
| **Database** | Oracle |
| **Command type** | StoredProcedure |
| **Business object** | N/A (Application layer) |
| **Criteria property** | N/A (Application layer) |
| **Lifecycle method** | N/A (Application layer) |
| **Application class** | `clsLegalData` — instantiated from this library's `LegalManagerBase.SetCurrentCase`; the type itself is a business-tier POCO with no `IBusinessCriteria` implementation* |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `aLegalCaseNum` | Input | Decimal | N/A | Legal case sequence number passed to `pk80001_legalNet.getHeader` to select the header row. |
| `recordset` | Output (REF CURSOR) | Cursor | N/A | Oracle REF CURSOR output parameter; consumed as a `clsResultSet`-style reader yielding `CaseNum`, `AttyName`, `CaseStatus`, `HearingDate` columns. |

## Tables

No tables are directly referenced by this application-layer call; all data access occurs inside the Oracle package body `pk80001_legalNet.getHeader`, which was not retrieved for this run**.

## Sample SQL

```sql
-- Stored procedure call (procedure body resides in the Oracle database)
pk80001_legalNet.getHeader(
  :aLegalCaseNum,
  :recordset)
```

`recordset` is an Oracle REF CURSOR output parameter (`AddCursorParm("recordset")`); the resulting rows are read for columns `CaseNum`, `AttyName`, `CaseStatus`, `HearingDate`. The procedure body resides in the Oracle database and was not retrieved for this run (see [Procedures](../procedures/index.md)).

## Operations and processes
- [Create/select legal case context](../operations/create-select-legal-case-context.md)

## Business rules
- [BR-LGL-001: Admin group bypasses claim-conflict and exposure checks](../business-rules.md#br-lgl-001-admin-group-bypasses-claim-conflict-and-exposure-checks)*
- [BR-LGL-002: Worker-conflict claims require conflict and exposure access](../business-rules.md#br-lgl-002-worker-conflict-claims-require-conflict-and-exposure-access)*
- [BR-LGL-003: Exposure-flagged claims require exposure access](../business-rules.md#br-lgl-003-exposure-flagged-claims-require-exposure-access)*

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts. Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Sources
- `SAIF.Application.Claim.Legal\clsLegalData.vb`
- `SAIF.Application.Claim.Legal\LegalManagerBase.vb`
